package com.example.bnuzzu.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.bnuzzu.common.dto.HouseListDto;
import com.example.bnuzzu.common.dto.RoommateListDto;
import com.example.bnuzzu.common.dto.SearchDto;
import com.example.bnuzzu.entity.Roommate;
import com.example.bnuzzu.mapper.HouseinfoMapper;
import com.example.bnuzzu.mapper.RoommateMapper;
import com.example.bnuzzu.service.RoommateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoommateServiceImpl extends ServiceImpl<RoommateMapper, Roommate>implements RoommateService {
    @Autowired
    RoommateMapper roommateMapper;
    @Override
    public IPage<RoommateListDto> searchPage(Page<?> page,  RoommateListDto roommateListDto) {
        page.setOptimizeCountSql(false);
        return roommateMapper.searchPage(page,roommateListDto);
    }

    @Override
    public List<RoommateListDto> getAllMate() {
        return roommateMapper.getAllMate();
    }
}
